﻿using System;
using System.Configuration;
using System.Data;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using KPIS.DBM;
using System.Data.SqlClient;
using System.Data.OleDb;
using KPIS.GERP.GHRMS.MODEL;

namespace KPIS.GERP.GHRMS.DAL
{
    public sealed class AbsenceTypeGroupDAL
    {
        IDBManager dbManager = new DBManager(SystemInfo._DataProvider, SystemInfo._ConnectionString);

        public AbsenceTypeGroupDAL()
        {

        }

        public DataSet LoadListAbsenceTypeGroup()
        {
            string strSQL;

            try
            {
                dbManager.Open();
                dbManager.CreateParameters(1);

                 dbManager.AddParameters(0, "@DeleteRecord", SystemInfo._DeleteRecordStatus);

                strSQL = "SELECT ABSENCE_TYPE_GROUP_SEQ, ABSENCE_TYPE_GROUP_NAME, REMARKS"
                    + " FROM HRM_PS_ABSENCE_TYPE_GROUPS"
                    + " WHERE RECORD_STATUS not like @DeleteRecord";
                
                return dbManager.ExecuteDataSet(CommandType.Text, strSQL);
            }
            catch
            {
                return null;
                throw;
            }
            finally
            {
                dbManager.Dispose();
            }
        }

    }
}
